package com.wangjiyuan.shiwupai.mine.activitiy;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.wangjiyuan.shiwupai.R;
import com.wangjiyuan.shiwupai.base.BaseActivity;

public class UploadFoodDataActivity extends BaseActivity implements View.OnClickListener{

    private Toolbar toolBar_uploadFoodData_back;
    private LinearLayout ll_uploadFoodData_item, ll_drafts_item;
    private Button btn_upload_food_item;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_upload_food_data);

        initToolBar();
        initView();
    }

    private void initView() {
        ll_uploadFoodData_item = (LinearLayout) findViewById(R.id.ll_uploadFoodData_item);
        ll_drafts_item = (LinearLayout) findViewById(R.id.ll_drafts_item);
        btn_upload_food_item = (Button) findViewById(R.id.btn_upload_food_item);
        
        ll_uploadFoodData_item.setOnClickListener(this);
        ll_drafts_item.setOnClickListener(this);
        btn_upload_food_item.setOnClickListener(this);
    }

    private void initToolBar() {
        toolBar_uploadFoodData_back = (Toolbar) findViewById(R.id.toolBar_uploadFoodData_back);
        toolBar_uploadFoodData_back.setTitle("上传食物");
        toolBar_uploadFoodData_back.setNavigationIcon(R.mipmap.icon_back_black);
        toolBar_uploadFoodData_back.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.ll_uploadFoodData_item:
                Toast.makeText(mContent, "我上传的食物", Toast.LENGTH_SHORT).show();
                break;
            case R.id.ll_drafts_item:
                Toast.makeText(mContent, "草稿箱", Toast.LENGTH_SHORT).show();
                break;
            case R.id.btn_upload_food_item:
                Intent intent = new Intent(UploadFoodDataActivity.this, UploadFoodActivity.class);
                startActivity(intent);
                break;
        }
    }
}
